/**	
	*	
	*	define
	*				
	*	khoi tao bien dung chung cua chuong tirnh		
	*		
	*	History:	
	*			
	
	*			DATE									AUTHOR						DESCRIPTION		
	*		--------------------------------------------------------------------------------------		
	*		24-Oct-2012			Nguyennv							Create	new	
	*
*/
/*-------------------------START NGUYENNV-------------------------------*/
var DIALOG_POPUP;												/* Dialog 						 */
var COLOR_BORDER 			= "#C0C0C0"; 						/* Border color					 */
var COLOR_BG_HEADER 		= "#C0C0C0";						/* Background color header		 */
var COLOR_FEATURE_DEFAULT 	= "#000000";
var CELL_PADDING 			= "0px 5px 0px 5px";				/* Padding cell				     */
var URL_POPUP 				= "/AnGiang-557-portlet/html/giamsatmoitruong/popup.jsp"; 	/* Popup jsp page	 */
var IMG_ZOOM_SRC			= "/AnGiang-557-portlet/css/img/zoomToFeatures.png";/* Zoom image */
var IMG_VIEW_SRC			= "/AnGiang-557-portlet/html/giamsatmoitruong/img/viewDetail.png";/* View image */
var IMG_CANCEL_SRC			= "/AnGiang-557-portlet/html/giamsatmoitruong/img/cancel.png";
var IMG_SETTING_SRC			= "/AnGiang-557-portlet/html/giamsatmoitruong/img/settings.png";
var IMG_THEMATIC_SRC		= "/AnGiang-557-portlet/Styles/img/";
var COMBO_ID_LAYER;												/* Using in case of searching    */
var LAYER_ID_CURRENT;
var DIV_POPUP_CONTENT_INFOR = 'divContentInfor'; 				/* Div content on popup			 */
var DIV_DANH_SACH_TAI_SAN   = 'divDanhDachTaiSan'; 				/* Div list of assets on map	 */
var DIV_MAP_CONTENT 		= "idMapContent";					/* Div content that display on map	 */
var DIV_MAP_CONTENT_HEADER  = "idMapContentHeader";				/* Div content header			 */
var DIV_MAP_CONTENT_FOOTER  = "divMapContentFooter";			/* Div content footer			 */
var DIV_SEARCH_HEADER 		= "div_search_header";				/* Div search header			 */
var DIV_SEARCH_CONTENT 		= "div_search_content";				/* Div search content			 */
var DIV_SEARCH_FOOTER 		= "div_search_footer";				/* Div search footer			 */
var DIV_LEGEND_MAP 			= "idthematic";
var DIV_DANH_SACH_BONGDEN 	= "toolbarBongDen";
var URL_XML_THEMATIC		= "/AnGiang-557-portlet/Config/thematic.xml";
var URL_THEMATIC 			= "/AnGiang-557-portlet/html/giamsatmoitruong/thematic.jsp"; 	/* Popup jsp page	 */

var ARRAY_QUANHUYEN;											/* List of quan huyen		     */
var ARRAY_COUNT = new Array();
var TABLE_STORE_LAYER ;
var ARR_FIELD_ALIAS_CURRENT ;									/*	Store current alias			 */
var arrField_Alias = new Array();					
// action types
var IS_READING_DATA = 0;											/* Is reading data from database */
var COMPLETED_WAITING = 0;											/* Is completed reading data     */
var FLAG_COMPLETETED = false;
var TYPE_OF_POPUP;   							 				/* Type of popup 				 */
var NO_RECORD_PER_PAGE 		= 5;								/* Number of record per page	 */
var NO_PAGE = 5;
var WIDTH_SELECT_CONTRL 	= 130;								/* Width of selection control    */
/* define array */									
var ARR_FEATURE_DETAIL_INFOR;   								/* Storing detail infor of one feature */
var ARR_LAYER_RESULT;								   			/* Array store result of searching	   */
var INDEX_LAYER_PHKH = 0;										/* index of PHKH layer */
var INDEX_MODULE = 0;											/* index of current module */
var LEVEL_TOOLBARITEM = 0;										/* cap level toolbar item dc chon */
var QHCHUNG_COOKIE = "558_cpms_qh";						/* cap level toolbar item dc chon */
var SYNSTIME_COOKIE = "";
var SYNSTIME_COOKIE_BTS_1 = "";
var SYNSTIME_COOKIE_BTS_2 = "";
var SYNSTIME_COOKIE_CTNgam = "";
var SYNSTIME_COOKIE_KhacNhao = "";
// xac dinh xem truy van khong gian hay ko
var ISQUERYSPATIAL = false;
var RESOLUTIONS = [];

// danh sach loai giay phep xd
GPXD =
{
	none: 0,
	viahetamthoi: 1,
	thicongct: 2,
	xdtrambts: 3,
	ctngamdothi: 4,
	xdnhao: 5,
	nhaoriengle: 6,
	xdtrambts_2: 7
};

// danh sach cac module
ListModule = 
{
	none: 0,
	quanlyDQT: 1,
	quanlyDQT_thematic: 3,
	viewKhoangSan:2,
	commonGis:4
};

LayerAssetName =
{
	diem_dat_dqt: 'giss_a_gsmt_diem_dat_dqt',
	diem_kk_dqt: 'giss_a_gsmt_diem_kk_dqt',
	diem_nuoc_dqt: 'giss_a_gsmt_diem_nuoc_dqt',
	thuadat: 'giss_cpms_a_thuadat',
	chiGioiduongdo: 'giss_cpms_a_chigioiduongdo',
	chiGioixaydung: 'giss_cpms_a_chigioixaydung',
	diemCapphep: 'giss_cpms_a_diemcapphep',
	diemVipham: 'giss_cpms_a_diemvipham',
	quyHoachchitiet: 'giss_cpms_a_quyhoachchitiet',
	quyHoachChung: 'giss_cpms_a_quyhoachchung',
	dayDan: 'giss_pl_a_daydan',
	boDen: 'giss_pl_a_truden',
	tramBienAp: 'giss_pl_a_trambienap',
	hoGa: 'giss_dw_a_hoga',
	tuyenCong: 'giss_dw_a_cong',
	hientrangsudungdat: 'giss_lurs_a_hientrangsdd',
	giss_lurs_a_quyhoachsdd: 'giss_lurs_a_hientrangsdd',
	cheBienKhoangSan:'giss_a_qlks_cbks',
	khaiThacKhoangSan:'giss_a_qlks_ktks',
	thamDoKS:'giss_a_qlks_tdks',
	diemThamDoNuoc:'giss_a_qlnn_diemthamdo',
	diemKTNuocMat:'giss_a_qlnn_diemkhaithacnuocmat',
	diemXaThai:'giss_a_qlnn_diemxathai',
	diemKhoanGieng:'giss_a_qlnn_diemkhoangieng',
	diemONhiem:'giss_a_qlmt_diem_o_nhiem',
	diemNguonThai:'giss_a_qlmt_diem_nguonthai_ctnh',
	diemXuLy:'giss_a_qlmt_diem_xuly_ctnh',
	diemTapKet:'giss_a_qlmt_diem_tapket_plnk',
	vungCapPhep:"giss_a_qlks_phep",
	camKhaiThac:"giss_a_qlks_vung_camkt",
	vungDauTu:"giss_a_qlks_vung_dautu",
	vungQuyHoach:"giss_a_qlks_vung_quyhoach",
	
};

LayerFieldId = {
		cheBienKhoangSan:'ma_dangky',
		khaiThacKhoangSan:'ma_dangky',
		diemCapPhep:'id',
		diemCapPhepCat:'id',
		thamDoKS:'ma_dangky',
		thamDoTemp:'ma_dangky',
		camKhaiThac:'id',
		vungDauTu:'id',
		vungQuyHoach:'id',
		vungKsTv:'id'
};


CurrentLayer = 
{
		layerId: null,
		name: "",
		alias: "",
		length: 0,
		arrAlias: null,
		arrFeatureId: null,
		create:function(){
			this.layerId = null;
			this.name = "";
			this.length =  0;
			this.arrAlias = new Array();
			this.arrFeatureId = new Array();
		}
},
HtmlObject = 
{
		Hr : document.createElement("hr"),
		Label: document.createElement("label")
};
Popup_Type =													/* Type of popup 				*/
{
	Display_Detail_Infor: 1,
	Display_Poligon_Contain_Point: 2
};
/* List of functions in this application */
Fuctions = 
{
	selectFeature: 			100,
	openAttributes: 		101,
	searchAttributes: 		102,
	searchFeatureInside: 	103,
	editFeature:			104,
	addFeature:				105,
	searchInsidePolygon:	106,
	thematicMap:			107,
	bookMark:				108,
	identify:				109,
	exportMap:				110,
	importExcel:			111,
	measure:				102,
	pan:					103,
	statistic:				104
};
/* Current function 					*/
CurrentFunction = 
{
	name: 0,
	isOn:  false,
	close:function(){
		
		switch(this.name)
		{
		case Fuctions.selectFeature:
			
			 ScanFeature.close();
		  break;
		case Fuctions.openAttributes:
				
			  break;
		case Fuctions.searchAttributes:
			
			 SearchingAttribute.close();
			  break;
		case Fuctions.searchFeatureInside:
			
			  break;
		case Fuctions.editFeature:
			
			  break;
		case Fuctions.addFeature:
			
			  break;
		case Fuctions.searchInsidePolygon:
			
			 ScanFeature.close();
			  break;
		case Fuctions.thematicMap:
			
			 Thematic.close();
			  break;
		case Fuctions.bookMark:
			
			  break;
		case Fuctions.identify:
			
			  break;
		case Fuctions.exportMap:
			
			  break;
		case Fuctions.importExcel:
			
			  break;
		default:
			  break;
		}
		this.name = 0;
		this.isOn = false;
	}
};
DivObject = {
		DIV_SEARCH_BY_DRAW_POLYGONE : 'div_content_search_draw_polygone',
		DIV_SEARCH_INSIDE_DISTRICT : 'div_content_search_inside_district',
		DIV_SEARCH_BY_SELECTION : 'div_content_search_by_selection',
		DIV_CONTENT_LISTASSET_BY_SELECTION: 'div_list_assets_search_by_selection',
		SELECT_TOOL_COMBO_DISTRICT: 'select_Tool_cbo_district',
		DIV_LIST_ASSET_INSIDE_DISTRICT: 'div_list_assets_inside_district',
		DIV_VIEW_DETAIL_FEATURE_INFO:	'div_view_detail_feature_info'
};
/*-------------------------START NGUYENNV---------------------------------*/